home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC Gamer (Italian) 36
/
PC Gamer IT CD 36 2-2.iso
/
VIGDEMO
/
data1.cab
/
Assets
/
scripts
/
fan.e
< prev
next >
Wrap
Text File
|
1998-09-21
|
3KB
|
558 lines
int Initialize(string type) {
global int mystate = 2;
global int gNetwork = 0;
global real gInRadius = 50.0;
global real gOutRadius = 90.0;
global int gStartSound = 45;
global int gProgressSound = -1;
global int gEndSound = 45;
global int gLoopSoundHandle = 0;
Reset("hello");
}
int Reset(string dummy)
{
StopLowLevel();
mystate = 2;
SetCollidableProperties(thisObject,0,0);
SetStyle(thisObject,1);
wakeupTime = 0.1;
stopLoopSound();
}
int stopLoopSound()
{
if (gLoopSoundHandle != 0)
StopSound(thisObject,gLoopSoundHandle);
gLoopSoundHandle = 0;
}
int startsound(string soundname)
{
gStartSound = GetSoundIndex(soundname);
}
int endsound(string soundname)
{
gEndSound = GetSoundIndex(soundname);
}
int progresssound(string soundname)
{
gProgressSound = GetSoundIndex(soundname);
}
int start(string dummy)
{
if (mystate == 1)
mystate = 2;
else
mystate = 1;
TimedEvent(1);
}
int TimedEvent(int input)
{
real time;
time = GetTime(thisObject);
switch (mystate)
{
case 1:
StopLowLevel();
wakeupTime = -1.0;
break;
case 2:
StartLowLevel();
wakeupTime = -1.0;
break;
}
}
int StartLowLevel ()
{
Animate(thisObject,1,"open");
AnimSetPhase(thisObject,0.0);
PlaySound(thisObject,gStartSound);
return 0;
}
int EndLowLevel ()
{
Animate(thisObject,1,"open");
PlaySound(thisObject,gEndSound);
return 0;
}
int inradius(string str)
{
gInRadius = Str2Real(str);
}
int network(string str)
{
gNetwork = Str2Int(str);
}
int outradius(string str)
{
gOutRadius = Str2Real(str);
}
int Colliders(string dummy) {
return 0;
}